-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for ordering on character fields for sharded keyspace queries #7678
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ype is known Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
GuptaManan100
added
Component: Query Serving
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
labels
Mar 14, 2021
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
systay
reviewed
Mar 22, 2021
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
…string Signed-off-by: GuptaManan100 <manan@planetscale.com>
systay
reviewed
Mar 22, 2021
systay
reviewed
Mar 22, 2021
systay
reviewed
Mar 22, 2021
systay
reviewed
Mar 22, 2021
systay
reviewed
Mar 22, 2021
systay
reviewed
Mar 22, 2021
Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
systay
reviewed
Mar 23, 2021
Signed-off-by: Andres Taylor <andres@planetscale.com>
systay
approved these changes
Mar 23, 2021
Nice work! Does this close #7636? |
3 tasks
systay
pushed a commit
to systay/vitess
that referenced
this pull request
Sep 22, 2021
This is a backport of vitessio#8856 The regression in the linked issue was found to be occurring from adding weight_string function due to order by as introduced in vitessio#7678. MySQL however does not support the generated query - ``` select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a order by a asc ``` In order to fix this, we should also add the weight_string function to the group by clause as follows - ``` select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a, weight_string(ascii(val1)) order by a asc ``` Fixes vitessio#8855 Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Andres Taylor <andres@planetscale.com>
2 tasks
systay
added a commit
to planetscale/vitess
that referenced
this pull request
Sep 22, 2021
The regression in the linked issue was found to be occurring from adding weight_string function due to order by as introduced in vitessio#7678. MySQL does not support the generated query - ```sql select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a order by a asc ``` In order to fix this, we also add the weight_string function to the group by clause as follows - ``` select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a, weight_string(ascii(val1)) order by a asc ``` Co-authored-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Andres Taylor <andres@planetscale.com>
2 tasks
systay
added a commit
to planetscale/vitess
that referenced
this pull request
Sep 22, 2021
The regression in the linked issue was found to be occurring from adding weight_string function due to order by as introduced in vitessio#7678. MySQL does not support the generated query - ```sql select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a order by a asc ``` In order to fix this, we also add the weight_string function to the group by clause as follows - ``` select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a, weight_string(ascii(val1)) order by a asc ``` Co-authored-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Andres Taylor <andres@planetscale.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component: Query Serving
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for ordering on character fields for sharded keyspace queries. We now add weighted_strings for all the columns that we do not know the types for in order by clause and use it only in the case for VARCHAR, TEXT and such data types. After this change adding weight_strings will become the default and will support ordering for any columns.
For now, the planner is unable to figure out that MySQL functions like
MAX
,MIN
etc will return integral data if the input column in integral which means that it will add weight_strings for them i.e.Another shortcoming is that while ordering for all columns is supported,
GROUP BY
will not work for varchar columns since for now orderedAggregate still uses the original column for merging. i.eNotice that in the plan output the ordered aggregate is using 1,4 and 3 columns instead of 5,4 and 6. To support this the orderedAggregate will also have to store both the column and the weight_string column. The work on this has been postponed for later.
Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: